package cn.ecnu.pojo.resume;

import cn.ecnu.common.validated.InsertGroup;
import cn.ecnu.common.validated.UpdateGroup;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

@Data
@TableName(value = "resume_edu")
/* 求职者-教育经历 */
public class ResumeEdu{

//    @Null(message = "数据添加时，eduId不能赋值",groups = InsertGroup.class)
//    @NotNull(message = "数据更新时，eduId不能为空",groups = UpdateGroup.class)
    @TableId(value = "edu_id", type = IdType.AUTO)
    private Integer eduId;

    @NotNull(message = "userId不能为空")
    private Integer userId;

    @NotBlank(message = "学校名称不能为空")
    private String school;

    @NotBlank(message = "主修专业不能为空")
    private String major;

    @NotEmpty(message = "学历不能为空")
    private String qualification;

    @NotBlank(message = "学校所在地不能为空")
    private String eduLocation;

    private String eduDetail;

    @JsonFormat(pattern = "yyyy-MM")
    private Date eduStart;

    @JsonFormat(pattern = "yyyy-MM")
    private Date eduEnd;

    @Override
    public String toString() {
        return "{" +
                "学校:" + school  +
                ", 主修:" + major +
                ", 学历:" + qualification +
                '}';
    }
}
